//
//  NSDictionary+Helper.m
//  NewPor
//
//  Created by 中昊科技 on 15/4/27.
//  Copyright (c) 2015年 中昊科技. All rights reserved.
//

#import "NSDictionary+Helper.h"

@implementation NSDictionary (Helper)

-(NSString *)toJsonString
{
    NSError *error = nil;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self  options:NSJSONWritingPrettyPrinted error:&error];
    if ([jsonData length] > 0 && error == nil){
        NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
        return jsonString;
    }else{
        return @"";
    }
}

@end
